package com.evola.rm.model
{
	import com.evola.rm.view.project.ProjectModel;

	[Bindable]
	public class ResourceItem
	{

		public var key:ResourceKey;
		public var value:String;
		public var comment:String;
		
		public var model : ProjectModel;

		public function ResourceItem()
		{
		}

		public static function create(row:String, lastComment:String, model : ProjectModel):ResourceItem
		{

			var split:Array=row.split("=");

			var item:ResourceItem=new ResourceItem();
			item.key=ResourceKey.create(split[0], model);
			item.value=split[1];
			item.comment=lastComment;
			item.model = model;

			return item;
		}
		
		public function get displayName() : String{
			
			return key.expression;
		}
		
	}
}
